<?php
header('content-type:text/html;charset=utf-8');
session_start();
$sjh = $_POST['sjh'];
$pwd = $_POST['pwd'];
$din = "mysql:host=127.0.0.1;dbname=zgr";
$name = "root";
$password = "root";
$pdo = new PDO($din,$name,$password);
$res = $pdo->query("select * from lx8_may where sjh='$sjh' and pwd='$pwd' ")->fetch();
if($res)
{
    $_SESSION['usjh'] = $sjh;
    echo "<script>alert('登录成功');location.href='show.php';</script>";
}
else
{
    echo "<script>alert('登录失败,网络异常,请重试');location.href='login.html';</script>";
}
?>